
package GUI;

import Objetos.*;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Freddy Aparicio Marin, Ronald Melo Aldana
 */
public class VentanaPrincipal extends javax.swing.JFrame {
    DefaultTableModel modeloEstudiante;
    
   //<editor-fold defaultstate="collapsed" desc=" Metodos internos de la ventana principal ">
    
    void cargartablaEstudiantes()
    {
        String[] TitulostablaEstudiantes = {"Codigo", "Nombre", "Apellido", "Correo", "Telefono"};
        String[] registro = new String[5];
    }
    
    public void habilitar() {
        txtnumerosalon.setEnabled(true);
        txtcapacidad.setEnabled(true);
        cbosede.setEditable(true);
        BTNSalonesEliminar.setEnabled(true);
        BTNMateriasModificar.setEnabled(true);
    }

    public void inhabilitar() {
        cbosede.setEditable(false);
        BTNSalonesEliminar.setEnabled(false);
        BTNMateriasModificar.setEnabled(false);
    }

    public void borrarCamposEstudiantes() {

        TFEstudiantesCodigo.setText("");
        TFEstudiantesNombre.setText("");
        TFEstudiantesApellido.setText("");
        TFEstudiantesTelefono.setText("");
        TFEstudiantesCorreo.setText("");
    }

    public VentanaPrincipal() {
        initComponents();
        cbosede.addItem("60");
        cbosede.addItem("38");
        setLocationRelativeTo(null);
        inhabilitar();
    }

    public void registrarEstudiante() {

        Estudiante nuevoestudiante = new Estudiante();

        nuevoestudiante.setCodigoEstudiante(Integer.parseInt(TFEstudiantesCodigo.getText()));
        nuevoestudiante.setNombreEstudiante(TFEstudiantesNombre.getText());
        nuevoestudiante.setApellidoEstudiante(TFEstudiantesApellido.getText());
        nuevoestudiante.setTelefonoEstudiante(TFEstudiantesTelefono.getText());
        nuevoestudiante.setCorreoEstudiante(TFEstudiantesCorreo.getText());

        nuevoestudiante.RegistroDeEstudiantesEnBDOPAC();
        borrarCamposEstudiantes();
    }
        //</editor-fold>

    
    @SuppressWarnings("unchecked")

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedOpac = new javax.swing.JTabbedPane();
        jpanelEstudiantes = new javax.swing.JPanel();
        TFEstudiantesCodigo = new javax.swing.JTextField();
        TFEstudiantesNombre = new javax.swing.JTextField();
        TFEstudiantesApellido = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        TFEstudiantesTelefono = new javax.swing.JTextField();
        BTNEstudiantesRegistrar = new javax.swing.JButton();
        BTNEstudiantesConsultar = new javax.swing.JButton();
        BTNEstudiantesEliminar = new javax.swing.JButton();
        TFEstudiantesCorreo = new javax.swing.JTextField();
        BTNEstudiantesModificar = new javax.swing.JButton();
        BTNEstudiantesBorrarCampos = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanelMateria = new javax.swing.JPanel();
        jTextField9 = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jTextField10 = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jButton5 = new javax.swing.JButton();
        BTNMateriasRegistrar = new javax.swing.JButton();
        BTNMateriasEliminar = new javax.swing.JButton();
        jCheckBox4 = new javax.swing.JCheckBox();
        jCheckBox5 = new javax.swing.JCheckBox();
        jCheckBox6 = new javax.swing.JCheckBox();
        BTNMateriasModificar = new javax.swing.JButton();
        BTNMateriasBorrarCampos = new javax.swing.JButton();
        jLabel23 = new javax.swing.JLabel();
        jPanelSalones = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        chboxpc = new javax.swing.JCheckBox();
        chboxtv = new javax.swing.JCheckBox();
        chboxvideobeam = new javax.swing.JCheckBox();
        txtnumerosalon = new javax.swing.JTextField();
        cbosede = new javax.swing.JComboBox();
        BTNSalonesRegistrar = new javax.swing.JButton();
        BTNSalonesEliminar = new javax.swing.JButton();
        btnconsultar = new javax.swing.JButton();
        jLabel22 = new javax.swing.JLabel();
        txtcapacidad = new javax.swing.JTextField();
        BTNSalonesModificar = new javax.swing.JButton();
        BTNSalonesBorrarCampos = new javax.swing.JButton();
        jLabel24 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(910, 604));

        TFEstudiantesCodigo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TFEstudiantesCodigoActionPerformed(evt);
            }
        });

        jLabel1.setText("Codigo");

        jLabel2.setText("Nombre");

        jLabel3.setText("Apellido");

        jLabel4.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(0, 0, 204));
        jLabel4.setText("Procesos para estuadiantes");

        jLabel6.setText("Numero de Contacto");

        jLabel7.setText("Correo electronico");

        TFEstudiantesTelefono.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TFEstudiantesTelefonoActionPerformed(evt);
            }
        });

        BTNEstudiantesRegistrar.setText("Registrar");
        BTNEstudiantesRegistrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNEstudiantesRegistrarActionPerformed(evt);
            }
        });

        BTNEstudiantesConsultar.setText("Consultar");
        BTNEstudiantesConsultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNEstudiantesConsultarActionPerformed(evt);
            }
        });

        BTNEstudiantesEliminar.setText("Eliminar");
        BTNEstudiantesEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNEstudiantesEliminarActionPerformed(evt);
            }
        });

        TFEstudiantesCorreo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TFEstudiantesCorreoActionPerformed(evt);
            }
        });

        BTNEstudiantesModificar.setText("Modificar");
        BTNEstudiantesModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNEstudiantesModificarActionPerformed(evt);
            }
        });

        BTNEstudiantesBorrarCampos.setText("Borrar Campos");
        BTNEstudiantesBorrarCampos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNEstudiantesBorrarCamposActionPerformed(evt);
            }
        });

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout jpanelEstudiantesLayout = new javax.swing.GroupLayout(jpanelEstudiantes);
        jpanelEstudiantes.setLayout(jpanelEstudiantesLayout);
        jpanelEstudiantesLayout.setHorizontalGroup(
            jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(BTNEstudiantesEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(TFEstudiantesTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                                .addGap(11, 11, 11)
                                .addComponent(jLabel6)))
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                                .addGap(89, 89, 89)
                                .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(BTNEstudiantesConsultar)
                                    .addComponent(jLabel7)))
                            .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                                .addGap(74, 74, 74)
                                .addComponent(TFEstudiantesCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                                .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(TFEstudiantesCodigo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(TFEstudiantesNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(TFEstudiantesApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                                .addComponent(BTNEstudiantesRegistrar, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(36, 36, 36)
                                .addComponent(BTNEstudiantesModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(34, 34, 34)
                        .addComponent(BTNEstudiantesBorrarCampos)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 611, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(17, 17, 17))
        );
        jpanelEstudiantesLayout.setVerticalGroup(
            jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelEstudiantesLayout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addGap(36, 36, 36)
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(TFEstudiantesCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(BTNEstudiantesConsultar))
                        .addGap(18, 18, 18)
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(TFEstudiantesNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(TFEstudiantesApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jpanelEstudiantesLayout.createSequentialGroup()
                                .addGap(52, 52, 52)
                                .addComponent(jLabel7))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpanelEstudiantesLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel6)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(TFEstudiantesTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(TFEstudiantesCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(50, 50, 50)
                        .addGroup(jpanelEstudiantesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(BTNEstudiantesRegistrar)
                            .addComponent(BTNEstudiantesModificar)
                            .addComponent(BTNEstudiantesBorrarCampos))
                        .addGap(28, 28, 28)
                        .addComponent(BTNEstudiantesEliminar)
                        .addContainerGap(373, Short.MAX_VALUE))
                    .addComponent(jScrollPane1)))
        );

        jTabbedOpac.addTab("Estudiantes", jpanelEstudiantes);

        jLabel8.setText("Codigo");

        jLabel9.setText("Nombre");

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTable2);

        jButton5.setText("Consultar");

        BTNMateriasRegistrar.setText("Registrar");

        BTNMateriasEliminar.setText("Eliminar");

        jCheckBox4.setText("PC´s");

        jCheckBox5.setText("TV");

        jCheckBox6.setText("VideoBeam");

        BTNMateriasModificar.setText("Modificar");
        BTNMateriasModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNMateriasModificarActionPerformed(evt);
            }
        });

        BTNMateriasBorrarCampos.setText("Borrar Campos");
        BTNMateriasBorrarCampos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNMateriasBorrarCamposActionPerformed(evt);
            }
        });

        jLabel23.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel23.setForeground(new java.awt.Color(0, 0, 204));
        jLabel23.setText("Procesos para materias");

        javax.swing.GroupLayout jPanelMateriaLayout = new javax.swing.GroupLayout(jPanelMateria);
        jPanelMateria.setLayout(jPanelMateriaLayout);
        jPanelMateriaLayout.setHorizontalGroup(
            jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMateriaLayout.createSequentialGroup()
                .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelMateriaLayout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel23)
                            .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jCheckBox5))
                        .addGap(67, 67, 67)
                        .addComponent(jButton5))
                    .addGroup(jPanelMateriaLayout.createSequentialGroup()
                        .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelMateriaLayout.createSequentialGroup()
                                .addGap(25, 25, 25)
                                .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(BTNMateriasRegistrar, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(BTNMateriasEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanelMateriaLayout.createSequentialGroup()
                                .addGap(38, 38, 38)
                                .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jCheckBox4)
                                    .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel8)
                                        .addComponent(jLabel9)))))
                        .addGap(18, 18, 18)
                        .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelMateriaLayout.createSequentialGroup()
                                .addGap(91, 91, 91)
                                .addComponent(jCheckBox6))
                            .addGroup(jPanelMateriaLayout.createSequentialGroup()
                                .addComponent(BTNMateriasModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(BTNMateriasBorrarCampos)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 300, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 556, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(35, 35, 35))
        );
        jPanelMateriaLayout.setVerticalGroup(
            jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelMateriaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelMateriaLayout.createSequentialGroup()
                        .addGap(44, 44, 44)
                        .addComponent(jLabel23)
                        .addGap(46, 46, 46)
                        .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel8)
                            .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButton5)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9))
                        .addGap(24, 24, 24)
                        .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jCheckBox4)
                            .addComponent(jCheckBox5)
                            .addComponent(jCheckBox6))
                        .addGap(50, 50, 50)
                        .addGroup(jPanelMateriaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(BTNMateriasRegistrar)
                            .addComponent(BTNMateriasModificar)
                            .addComponent(BTNMateriasBorrarCampos))
                        .addGap(19, 19, 19)
                        .addComponent(BTNMateriasEliminar))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 562, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(240, Short.MAX_VALUE))
        );

        jTabbedOpac.addTab("Materias", jPanelMateria);

        jLabel5.setText("Numero de Salon");

        jLabel11.setText("Sede");

        chboxpc.setText("Pc´s");
        chboxpc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chboxpcActionPerformed(evt);
            }
        });

        chboxtv.setText("TV");

        chboxvideobeam.setText("VideoBeam");

        txtnumerosalon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtnumerosalonActionPerformed(evt);
            }
        });

        cbosede.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbosedeActionPerformed(evt);
            }
        });

        BTNSalonesRegistrar.setText("Registrar");
        BTNSalonesRegistrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNSalonesRegistrarActionPerformed(evt);
            }
        });

        BTNSalonesEliminar.setText("Eliminar");

        btnconsultar.setText("Consultar");

        jLabel22.setText("Capacidad");

        txtcapacidad.setToolTipText("");
        txtcapacidad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtcapacidadActionPerformed(evt);
            }
        });

        BTNSalonesModificar.setText("Modificar");
        BTNSalonesModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNSalonesModificarActionPerformed(evt);
            }
        });

        BTNSalonesBorrarCampos.setText("Borrar Campos");
        BTNSalonesBorrarCampos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTNSalonesBorrarCamposActionPerformed(evt);
            }
        });

        jLabel24.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel24.setForeground(new java.awt.Color(0, 0, 204));
        jLabel24.setText("Procesos para salones");

        javax.swing.GroupLayout jPanelSalonesLayout = new javax.swing.GroupLayout(jPanelSalones);
        jPanelSalones.setLayout(jPanelSalonesLayout);
        jPanelSalonesLayout.setHorizontalGroup(
            jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelSalonesLayout.createSequentialGroup()
                .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelSalonesLayout.createSequentialGroup()
                        .addGap(37, 37, 37)
                        .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel22)
                            .addComponent(jLabel11)
                            .addComponent(jLabel5))
                        .addGap(31, 31, 31)
                        .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelSalonesLayout.createSequentialGroup()
                                .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtnumerosalon, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtcapacidad, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addComponent(btnconsultar))
                            .addComponent(cbosede, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelSalonesLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(BTNSalonesRegistrar)
                            .addComponent(BTNSalonesEliminar))
                        .addGap(18, 18, 18)
                        .addComponent(BTNSalonesModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(BTNSalonesBorrarCampos))
                    .addGroup(jPanelSalonesLayout.createSequentialGroup()
                        .addGap(56, 56, 56)
                        .addComponent(chboxpc)
                        .addGap(64, 64, 64)
                        .addComponent(chboxtv)
                        .addGap(59, 59, 59)
                        .addComponent(chboxvideobeam))
                    .addGroup(jPanelSalonesLayout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(jLabel24)))
                .addGap(678, 853, Short.MAX_VALUE))
        );
        jPanelSalonesLayout.setVerticalGroup(
            jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelSalonesLayout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jLabel24)
                .addGap(37, 37, 37)
                .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtnumerosalon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(btnconsultar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtcapacidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cbosede, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addGap(47, 47, 47)
                .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chboxvideobeam)
                    .addComponent(chboxtv)
                    .addComponent(chboxpc))
                .addGap(39, 39, 39)
                .addGroup(jPanelSalonesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BTNSalonesRegistrar)
                    .addComponent(BTNSalonesModificar)
                    .addComponent(BTNSalonesBorrarCampos))
                .addGap(18, 18, 18)
                .addComponent(BTNSalonesEliminar)
                .addContainerGap(455, Short.MAX_VALUE))
        );

        jTabbedOpac.addTab("Salones", jPanelSalones);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedOpac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedOpac, javax.swing.GroupLayout.PREFERRED_SIZE, 838, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 12, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BTNSalonesBorrarCamposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNSalonesBorrarCamposActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTNSalonesBorrarCamposActionPerformed

    private void BTNSalonesModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNSalonesModificarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTNSalonesModificarActionPerformed

    private void txtcapacidadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtcapacidadActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtcapacidadActionPerformed

    private void BTNSalonesRegistrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNSalonesRegistrarActionPerformed

    }//GEN-LAST:event_BTNSalonesRegistrarActionPerformed

    private void cbosedeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbosedeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cbosedeActionPerformed

    private void txtnumerosalonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtnumerosalonActionPerformed

    }//GEN-LAST:event_txtnumerosalonActionPerformed

    private void chboxpcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chboxpcActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_chboxpcActionPerformed

    private void BTNMateriasBorrarCamposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNMateriasBorrarCamposActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTNMateriasBorrarCamposActionPerformed

    private void BTNMateriasModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNMateriasModificarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTNMateriasModificarActionPerformed

    private void BTNEstudiantesBorrarCamposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNEstudiantesBorrarCamposActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTNEstudiantesBorrarCamposActionPerformed

    private void BTNEstudiantesModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNEstudiantesModificarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTNEstudiantesModificarActionPerformed

    private void TFEstudiantesCorreoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TFEstudiantesCorreoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TFEstudiantesCorreoActionPerformed

    private void BTNEstudiantesEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNEstudiantesEliminarActionPerformed

    }//GEN-LAST:event_BTNEstudiantesEliminarActionPerformed

    private void BTNEstudiantesConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNEstudiantesConsultarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTNEstudiantesConsultarActionPerformed

    private void BTNEstudiantesRegistrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNEstudiantesRegistrarActionPerformed
        registrarEstudiante();
        //fin actionperformed Boton Registrar
    }//GEN-LAST:event_BTNEstudiantesRegistrarActionPerformed

    private void TFEstudiantesTelefonoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TFEstudiantesTelefonoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TFEstudiantesTelefonoActionPerformed

    private void TFEstudiantesCodigoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TFEstudiantesCodigoActionPerformed

    }//GEN-LAST:event_TFEstudiantesCodigoActionPerformed

//editor-fold>


    //<editor-fold defaultstate="collapsed" desc=" Inicio ejecucion de ventana ">

    public static void main(String args[]) {

        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(VentanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(VentanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(VentanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(VentanaPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VentanaPrincipal().setVisible(true);
            }
        });
    }
    //</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Declaracion de componentes ">
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BTNEstudiantesBorrarCampos;
    private javax.swing.JButton BTNEstudiantesConsultar;
    private javax.swing.JButton BTNEstudiantesEliminar;
    private javax.swing.JButton BTNEstudiantesModificar;
    private javax.swing.JButton BTNEstudiantesRegistrar;
    private javax.swing.JButton BTNMateriasBorrarCampos;
    private javax.swing.JButton BTNMateriasEliminar;
    private javax.swing.JButton BTNMateriasModificar;
    private javax.swing.JButton BTNMateriasRegistrar;
    private javax.swing.JButton BTNSalonesBorrarCampos;
    private javax.swing.JButton BTNSalonesEliminar;
    private javax.swing.JButton BTNSalonesModificar;
    private javax.swing.JButton BTNSalonesRegistrar;
    private javax.swing.JTextField TFEstudiantesApellido;
    private javax.swing.JTextField TFEstudiantesCodigo;
    private javax.swing.JTextField TFEstudiantesCorreo;
    private javax.swing.JTextField TFEstudiantesNombre;
    private javax.swing.JTextField TFEstudiantesTelefono;
    private javax.swing.JButton btnconsultar;
    private javax.swing.JComboBox cbosede;
    private javax.swing.JCheckBox chboxpc;
    private javax.swing.JCheckBox chboxtv;
    private javax.swing.JCheckBox chboxvideobeam;
    private javax.swing.JButton jButton5;
    private javax.swing.JCheckBox jCheckBox4;
    private javax.swing.JCheckBox jCheckBox5;
    private javax.swing.JCheckBox jCheckBox6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanelMateria;
    private javax.swing.JPanel jPanelSalones;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedOpac;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JPanel jpanelEstudiantes;
    private javax.swing.JTextField txtcapacidad;
    private javax.swing.JTextField txtnumerosalon;
    // End of variables declaration//GEN-END:variables
    //</editor-fold>
}